package com.demo.weixin;

import java.util.List;

import com.demo.menu.WxMenu;
import com.jfinal.kit.StringKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
@SuppressWarnings("serial")
public class WxContent  extends Model<WxContent>{
    public static final WxContent dao = new WxContent();
    /**
     * @param   where
     * @return  Record
     */
    public List<Record> findAlls(String where,String limit) {
        String sqlExp = " from wx_content";
        if(StringKit.notBlank(where)){
            sqlExp += " where " + where;
        }
       
        String order =" order by id desc ";
        return Db.find( "select * " +sqlExp +order +limit);

    }
    public Page<WxContent> page(int pageNumber, int pageSize, String where) {
        String sqlExp = "from wx_content";
        if(StringKit.notBlank(where)){
            sqlExp += " where " + where;
        }
        return paginate(pageNumber, pageSize, "select *", sqlExp);
    }
}
